package com.kj.xuyuan.mine;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.kj.xuyuan.R;
import com.kj.xuyuan.base.BaseActivity;
import com.kj.xuyuan.base.Constants;
import com.kj.xuyuan.util.SPUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 账号绑定
 */
public class BindAccountActivity extends BaseActivity {

    @BindView(R.id.tv_mobile)
    TextView tvMobile;
    @BindView(R.id.ll_mobile)
    LinearLayout llMobile;
    @BindView(R.id.tv_wx)
    TextView tvWx;
    @BindView(R.id.ll_wx)
    LinearLayout llWx;

    public static void actionStar(Context context){
        Intent intent = new Intent(context,BindAccountActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void init(Bundle savedInstanceState) {

    }

    @Override
    protected void onResume() {
        super.onResume();
        tvMobile.setText(SPUtils.getStringData(context, Constants.MOBILE,""));
        tvWx.setText(SPUtils.getStringData(context, Constants.WX_ACCOUNT,""));
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.activity_bind_account;
    }

    @Override
    protected void initView() {
        setTitleText("账号绑定");
    }

    @Override
    protected void initData() {

    }

    @Override
    protected int getTitleBarType() {
        return 0;
    }

    @OnClick({R.id.ll_mobile, R.id.ll_wx})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ll_mobile:
                ChangeMobileActivity.actionStar(context,1);
                finish();
                break;
            case R.id.ll_wx:
                ChangeMobileActivity.actionStar(context,2);
                finish();
                break;
        }
    }
}